﻿package com.sgcc.nfc.lock.core.util

import java.time.LocalDate
import java.time.LocalDateTime
import java.time.format.DateTimeFormatter

object DateUtils {
    private val dateTimeFormatter: DateTimeFormatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")

    fun todayStart(): String = LocalDate.now().atStartOfDay().format(dateTimeFormatter)

    fun todayEnd(): String = LocalDate.now().atTime(23, 59, 59).format(dateTimeFormatter)

    fun format(dateTime: LocalDateTime): String = dateTime.format(dateTimeFormatter)
}
